package com.student.db;


import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import java.util.List;

import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.Flowable;
import io.reactivex.rxjava3.core.Single;

@Dao
public interface RoomDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    public Completable insert(RoomEntity room);

    @Query("SELECT * FROM db_room")
    public Flowable<List<RoomEntity>> getRooms();


    @Query("SELECT * FROM db_room Where (roomNo=:roomNo)")
    public Single<RoomEntity> searchRooms(String roomNo);
}
